﻿namespace VisualPhysics.Scene.Core.Tests

open System
open System.Drawing
open VisualPhysics.Scene.Core
open VisualPhysics.Scene.Core.Operators
open VisualPhysics.Scene.Core.Tests.Utils
open NUnit.Framework
open FsUnit

type [<TestFixture>] ``HookObject tests``() =
    
    [<Test>]
    [<Category("HookObject.ValueMembers")>]
    member t.``Checking the Tag member of a HookObject``() =
        let ``The hook we are testing`` = HookObject(pol (14.1<cm>, 31.41<cm>))
        let ``The hook we are testing as Object`` = ``The hook we are testing``.Object()
        ``The hook we are testing as Object``.Tag |> should equal Hook

    [<Test>]
    [<Category("HookObject.ValueMembers")>]
    member t.``Checking the Position member of a HookObject``() =
        let ``The hook we are testing`` = HookObject(pol (14.1<cm>, 31.41<cm>))
        let ``The hook we are testing as Object`` = ``The hook we are testing``.Object()
        ``The hook we are testing as Object``.CarPosition
        |> equalTuples (14.1<cm>, 31.41<cm>)
        |> should equal (14.1<cm>, 31.41<cm>)

    [<Test>]
    [<Category("HookObject.ValueMembers")>]
    member t.``Checking the Color member of a HookObject``() =
        let ``The hook we are testing`` = HookObject(pol (14.1<cm>, 31.41<cm>))
        let ``The hook we are testing as Object`` = ``The hook we are testing``.Object()
        ``The hook we are testing as Object``.Color |> should equal Brushes.Black

    [<Test>]
    [<Category("HookObject.ValueMembers")>]
    member t.``Checking the Mass member of a HookObject``() =
        let ``The hook we are testing`` = HookObject(pol (14.1<cm>, 31.41<cm>))
        let ``The hook we are testing as Object`` = ``The hook we are testing``.Object()
        ``The hook we are testing as Object``.Mass |> should equal (Double.PositiveInfinity * 1.0<gram>)
        
    [<Test>]
    [<Category("HookObject.Setters")>]
    member t.``Changing the position of a HookObject as Object``() =
        let ``The hook we are testing`` = HookObject(pol (14.1<cm>, 31.41<cm>))
        let ``The hook we are testing as Object`` = ``The hook we are testing``.Object()
        let ``The new hook`` = ``The hook we are testing as Object``.SetCarPosition (4.0<cm>, 6.0<cm>)
        ``The new hook``.CarPosition |> should equal (4.0<cm>, 6.0<cm>)

    [<Test>]
    [<Category("HookObject.Setters")>]
    member t.``Changing the color of a HookObject as Object``() =
        let ``The hook we are testing`` = HookObject(pol (14.1<cm>, 31.41<cm>))
        let ``The hook we are testing as Object`` = ``The hook we are testing``.Object()
        let ``The new hook`` = ``The hook we are testing as Object``.SetColor Brushes.Orange
        ``The new hook``.Color |> should equal Brushes.Orange